﻿using Prism.Commands;
using Prism.Mvvm;
using System.Windows;

namespace Prism2.ViewModels
{
    public class MainWindowViewModel : BindableBase
    {
        private string _title = "Prism Application";
        public string Title
        {
            get { return _title; }
            set { SetProperty(ref _title, value); }
        }


        public DelegateCommand DelegateCommand { get; }
        public DelegateCommand<string> ParamCommand { get; }
        public CompositeCommand CompositeCommand { get; }

        public MainWindowViewModel()
        {
            DelegateCommand = new DelegateCommand(() =>
            {
                MessageBox.Show("无参的DelegateCommand");
            });

            ParamCommand = new DelegateCommand<string>((message) =>
            {
                MessageBox.Show(message);
            });
            CompositeCommand = new CompositeCommand();
            CompositeCommand.RegisterCommand(DelegateCommand);
            CompositeCommand.RegisterCommand(ParamCommand);

         
        }


    }


}
